home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / linuxcon.000 / linuxcon / linuxconf-1.6 / dialog / diadef.h < prev    next >
C/C++ Source or Header  |  1996-03-24  |  4KB  |  140 lines

  1. #ifndef DIADEF_H
  2. #define DIADEF_H
  3. /*
  4.  *  dialog.h -- common declarations for all dialog modules
  5.  *
  6.  *  AUTHOR: Savio Lam (lam836@cs.cuhk.hk)
  7.  *
  8.  *  This program is free software; you can redistribute it and/or
  9.  *  modify it under the terms of the GNU General Public License
  10.  *  as published by the Free Software Foundation; either version 2
  11.  *  of the License, or (at your option) any later version.
  12.  *
  13.  *  This program is distributed in the hope that it will be useful,
  14.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  *  GNU General Public License for more details.
  17.  *
  18.  *  You should have received a copy of the GNU General Public License
  19.  *  along with this program; if not, write to the Free Software
  20.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23. #include <sys/types.h>
  24. #include <fcntl.h>
  25. #include <unistd.h>
  26. #include <ctype.h>
  27. #include <stdlib.h>
  28. #include <string.h>
  29.  
  30. #ifdef HAVE_NCURSES
  31. #include <ncurses/curses.h>
  32.  
  33. #else
  34.  
  35. #ifdef ultrix
  36. #include <cursesX.h>
  37. #else
  38. #include <curses.h>
  39. #endif
  40.  
  41. #endif
  42.  
  43.  
  44. /*
  45.  * Change these if you want
  46.  */
  47. #define USE_SHADOW TRUE
  48. #define USE_COLORS TRUE
  49.  
  50.  
  51.  
  52. #define ESC 27
  53. #define TAB 9
  54. #define DEL    0x7f
  55. #define INS 0x7e
  56. #define MAX_LEN 2048
  57. #define BUF_SIZE (10*1024)
  58. #define MIN(x,y) (x < y ? x : y)
  59. #define MAX(x,y) (x > y ? x : y)
  60.  
  61. #ifndef HAVE_NCURSES
  62. #ifndef ACS_ULCORNER
  63. #define ACS_ULCORNER '+'
  64. #endif
  65. #ifndef ACS_LLCORNER
  66. #define ACS_LLCORNER '+'
  67. #endif
  68. #ifndef ACS_URCORNER
  69. #define ACS_URCORNER '+'
  70. #endif
  71. #ifndef ACS_LRCORNER
  72. #define ACS_LRCORNER '+'
  73. #endif
  74. #ifndef ACS_HLINE
  75. #define ACS_HLINE '-'
  76. #endif
  77. #ifndef ACS_VLINE
  78. #define ACS_VLINE '|'
  79. #endif
  80. #ifndef ACS_LTEE
  81. #define ACS_LTEE '+'
  82. #endif
  83. #ifndef ACS_RTEE
  84. #define ACS_RTEE '+'
  85. #endif
  86. #ifndef ACS_UARROW
  87. #define ACS_UARROW '^'
  88. #endif
  89. #ifndef ACS_DARROW
  90. #define ACS_DARROW 'v'
  91. #endif
  92. #endif    /* HAVE_NCURSES */
  93.  
  94.  
  95. /* 
  96.  * Attribute names
  97.  */
  98. #define screen_attr                   attributes[0]
  99. #define shadow_attr                   attributes[1]
  100. #define dialog_attr                   attributes[2]
  101. #define title_attr                    attributes[3]
  102. #define border_attr                   attributes[4]
  103. #define button_active_attr            attributes[5]
  104. #define button_inactive_attr          attributes[6]
  105. #define button_key_active_attr        attributes[7]
  106. #define button_key_inactive_attr      attributes[8]
  107. #define button_label_active_attr      attributes[9]
  108. #define button_label_inactive_attr    attributes[10]
  109. #define inputbox_attr                 attributes[11]
  110. #define inputbox_border_attr          attributes[12]
  111. #define searchbox_attr                attributes[13]
  112. #define searchbox_title_attr          attributes[14]
  113. #define searchbox_border_attr         attributes[15]
  114. #define position_indicator_attr       attributes[16]
  115. #define menubox_attr                  attributes[17]
  116. #define menubox_border_attr           attributes[18]
  117. #define item_attr                     attributes[19]
  118. #define item_selected_attr            attributes[20]
  119. #define tag_attr                      attributes[21]
  120. #define tag_selected_attr             attributes[22]
  121. #define tag_key_attr                  attributes[23]
  122. #define tag_key_selected_attr         attributes[24]
  123. #define check_attr                    attributes[25]
  124. #define check_selected_attr           attributes[26]
  125. #define uarrow_attr                   attributes[27]
  126. #define darrow_attr                   attributes[28]
  127. #define border_attr_shadow              attributes[29]
  128. /* number of attributes */
  129. #define ATTRIBUTE_COUNT               30
  130.  
  131.  
  132. #ifdef HAVE_NCURSES
  133. extern bool use_colors;
  134. extern bool use_shadow;
  135. #endif
  136.  
  137. extern chtype attributes[];
  138.  
  139. #endif
  140.